#include<iostream>
#include "StdMystring.h"
class Complex
{
    public:
    Complex():real(0),vir(0){}
    Complex(int real,int vir):real(real),vir(vir){}
    void show()
    {
        std::cout<<real<<"+"<<vir<<"i"<<std::endl;


    }
    Complex operator+(const Complex& c1)
    {
        Complex result;
        result.real=c1.real+real;
        result.vir=c1.vir+vir;
        return result;

    }
    Complex operator-(const Complex &c1)
    {
        Complex result;
        result.real=real-c1.real;
        result.vir=vir-c1.vir;
        return result;


    }
    //前置++
    Complex& operator++()
    {   
        real++;
        vir++;
        return *this;

    }
    //后置++
     Complex operator++(int)
    {   
        Complex result=*this;
        real++;
        vir++;
        return result;


    }
    friend  std::istream& operator>>(std::iostream&is,Complex&c);
    friend  std::ostream&   operator<<(std::ostream& os,const Complex&c);
    private:

    int real;
    int vir;

};

    std::ostream&  operator<<(std::ostream& os,const Complex&c)
     {
        os<<c.real<<"+"<<c.vir<<"i"<<std::endl;
        return os;

     }
     
     std::istream& operator>>(std::iostream&is,Complex&c)
     {

        is>>c.real>>c.vir;
        return is;

     }


int  main()
{

Complex c1(1,2);
Complex c2(2,3);
// c1.show();
// c2.show();

// Complex c= c1+c2;
// c.show();
Complex c;


std::cout<<c1<<c2;
return 0;


}